{include file="header.html"}
<div id="rightTop">
    <p>访客数统计</p>
</div>
<div class="mrightTop">
    <div class="fontl">
        <form method="get">
            <div class="left">
                <input type="hidden" name="app" value="stat_product" />
                <input type="hidden" name="act" value="statistics" />


                <div class="left">
                    <input class="txt date" type="text" value="{$search_arr.day.search_time|date:Y-m-d}" id="search_time" name="search_time">
                </div>

                <input type="submit" class="formbtn" value="{$lang.query}" />

                <input type="hidden" id="export_type" name="export_type" data-param='{"url":"{$actionurl}&exporttype=excel"}' value="excel"/>
                <a class="btn1" href="javascript:void(0);" id="export_btn"><span>导出excel</span></a>

            </div>
            <!--{if $filtered}-->
            <a class="left formbtn1" href="index.php?app=stat_product&act=statistics">{$lang.cancel_query}</a>
            <!--{/if}-->
        </form>
    </div>
</div>


<div class="tdare">
    <table width="100%" cellspacing="0" class="dataTable">
        <thead>
        <tr class="tatr1">
            <!--{foreach from=$statlist.headertitle item=v key=k name=name}-->
            <td <!--{if $smarty.foreach.name.first}-->class="firstCell"<!--{/if}-->>{$v}</td>
            <!--{/foreach}-->
        </tr>
        </thead>
        <tbody id="datatable">
        <!--{if $statlist.data}-->
        <!--{foreach from=$statlist.data item=v key=k}-->
        <tr class="tatr2">
            <td class="firstCell">{$v.id|escape}</td>
            <td>{$v.create_time|date:complete}</td>
            <td>{$v.spu_count|escape}</td>
            <td>{$v.sku_count|escape}</td>
            <td>{$v.self_stock_sum|escape}</td>
            <td>{$v.agent_stock_sum|escape}</td>
            <td>{$v.self_stock_price_total|escape}</td>
            <td>{$v.agent_stock_price_total|escape}</td>
            <td>{$v.vendor_count|escape}</td>
            <td>{$v.avg_price|escape}</td>
        </tr>
        <!--{/foreach}-->
        <!--{else}-->
        <tr class="no_data">
            <td colspan="5">{$lang.no_data}</td>
        </tr>
        <!--{/if}-->
        </tbody>
    </table>
    <div class="pageLinks">{include file=page.bottom.html}</div>
</div>
<script>
    $(function() {
        //统计数据类型
        var s_type = $("#search_type").val();
        $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});

        show_searchtime();
        $("#search_type").change(function() {
            show_searchtime();
        });
        //展示搜索时间框
        function show_searchtime() {

            s_type = $("#search_type").val();

            $("[id^='searchtype_']").hide();

            $("#searchtype_" + s_type).show();
        }



        //导出图表
        $("#export_btn").click(function() {
            var item = $("#export_type");
            var type = $(item).val();
            if (type == 'excel') {
                download_excel(item);
            }
        });

    });

</script>


{include file="footer.html"}